package com.vainycos.customer.controller;

import com.vainycos.core.feign.supermarket.MarketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Vainycos
 * @description
 * @date: 2023/1/16 13:27
 */
@RequestMapping("/customer")
@RestController
public class CustomerController {

    @Autowired
    private MarketService marketService;

    @GetMapping("/getUser/{id}")
    public String getById(@PathVariable("id") Integer id){
        return "获取id=" + id + "的用户";
    }

    @GetMapping("/listMarket/{id}")
    public String listMarket(@PathVariable("id") Integer id){
        String goods = marketService.listMarket();
        return "用户id=" + id + "查询商品列表：" + goods;
    }
}
